package chinatelecom.feilong.framework.web.sys.service;

import chinatelecom.feilong.framework.web.sys.entity.Dictionary;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

/**
 * Created by hnayan on 2017/9/4.
 */
public interface IDictionaryService {
    /***
     * 保存一条dictionary信息
     * @param dictionary
     * @return bdspDictionary
     */
    Dictionary saveOrUpdateDictionary(Dictionary dictionary);

    /**
     * 根据条件分页查询数据
     * @param params
     * @param pageable
     * @return Page<SysUser>
     */
    Page<Dictionary> findConfigPageByParams(Map<String, Object> params, Pageable pageable, String sortName, String sortValue);

    /***
     * 根据ID查找Dictionary
     * @param id
     * @return bdspDictionary
     */
    Dictionary findOneBdspDictionary(int id);

    /***
     * 根据code查找Dictionary
     * @param code
     * @return bdspDictionary
     */
    Dictionary findByCode(String code);

    /***
     * 批量删除
     * @param ids
     * @return bdspDictionary
     */
    void deleteDictionariesByIds(String[] ids);

    /***
     * 根据code保存Dictionary
     * @param code
     * @return bdspDictionary
     */
    Dictionary saveDictionariesByCode(Dictionary dictionary, String code);

    /**
     * 根据PID查找数据字典列表
     * @param pId
     * @return
     */
    List<Dictionary> findDictionaryListByPId(Integer pId);

    /**
     * 根据父ID和code来查询一个字段对象
     * @param pId
     * @param code
     * @return
     */
    Dictionary findOneDictionaryByPIdAndCode(Integer pId,String code);

}
